package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.ProductEvent;
import com.rockcent.mall.lib.dto.MerchantCustomerStatisticsDto;
import com.rockcent.mall.lib.dto.StatisticDto;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by DK on 16/9/19.
 * 统计
 */
@Repository
public interface ProductEventRepositoryCustom {
    List<ProductEvent> findProductStatisticByproductId(Long id);

    StatisticDto findCustomerShareInCome(Long sharerId);

    /**
     * 统计该用户近30天访问量的前10的访问记录，customerId为空时查近30天所有记录
     */
    List<ProductEvent> getTop10(Long customerId, Long mallId);

    List<ProductEvent> findBySharerIdAndDateCreatedBetween(Long id, String firstDate, String lastDate);

    List<MerchantCustomerStatisticsDto> findCustomersByMerchantIdandDate(Long mallId, Long merchantId, String startDate, String endDate, String groupBy);

    List<ProductEvent> findTwoHourData();

    List<ProductEvent> findProductStatisticViewCountByproductId(Long productId, Long mallId, Long merchantId);

    List<Long> getTop10WithinThreeMonths(Long customerId, Long mallId);

    List<Long> findTop10ProductsOderbyTotalSaled(List<Long> productIdList);


}
